package com.example.personnel_oa.service.impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.comment_oa.pojos.Interview;
import com.example.personnel_oa.mapper.InterviewMapper;
import com.example.personnel_oa.service.InterviewService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author HEYONG
* @description 针对表【interview】的数据库操作Service实现
* @createDate 2022-11-03 21:32:49
*/
@Service
public class InterviewServiceImpl extends ServiceImpl<InterviewMapper, Interview>
implements InterviewService {
    @Autowired
    InterviewMapper interviewMapper;

    //查询全部面试数据
    @Override
    public List<Interview> selectInter() {
        List<Interview> interviews = interviewMapper.selectInter();
        return interviews;
    }

    //根据搜索框查询
    @Override
    public List<Interview> interview(Interview interview) {
        List<Interview> interview1 = interviewMapper.interview(interview);
        return interview1;
    }

    //根据id查询面试详情
    @Override
    public Interview interId(int interId) {
        Interview interview = interviewMapper.interId(interId);
        return interview;
    }

    //新增面试安排
    @Override
    public int addInter(Interview interview) {
        int i = interviewMapper.addInter(interview);
        return i;
    }

    //面试中修改数据
    @Override
    public int xiugai(Interview interview) {
        int xiugai = interviewMapper.xiugai(interview);
        return xiugai;
    }
    //新增二次面试安排
    @Override
    public int addInters(Interview interview) {
        int i = interviewMapper.addInters(interview);
        if (i> 0 ){
            //二面安排成功后不显示一面数据
            int stater = interviewMapper.stater(interview.getInterId());
        }
        return i;
    }

    //批量新增面试
    @Override
    public int addsmianshi(Interview interview) {
        int i = interviewMapper.addsmianshi(interview);
        return i;
    }
}
